let layer,$
layui.use(['layer','jquery'],function () {
    layer=layui.layer,$=layui.jquery;

    // 绑定登录按钮的点击事件
    $('#login').click(function () {
        let doctorId=$('#doctorId').val();
        let password=$('#password').val();
        console.log("doctorId=%s,password=%s",doctorId,password);

        // 1.定义固定盐
        let salt="f1g2h3j4";
        // 2.将输入的明文密码与固定盐进行混淆
        let temp=salt.charAt(1)+""+salt.charAt(5)+password+salt.charAt(0)+""+salt.charAt(3);
        // 3.进行MD5加密
        let pwd1=md5(temp);

        $.post('doctor/userLogin',{
            doctorId:doctorId,
            password:pwd1
        },function (rs) {
            console.log(rs);
            if(rs.code==200){
                layer.msg('登录成功！',{icon:6},function () {
                    location.href='examine/toExamine';
                });
            }else{
                layer.msg(rs.msg,{icon:5},function(){});
            }
        },'json');
    });
})